﻿@{
    ViewBag.Title = "NewsDetail";
    Layout = "/Views/Shared/_Layout.cshtml";
}

<!DOCTYPE html>

<html>
<head>
    <title>Contact: We will reply you soon, Thanks!</title>
    <script type="text/javascript" src="/Scripts/chatJs/cookie.js"></script>
    <script type="text/javascript" src="/Scripts/chatJs/en.js"></script>
    <link href="/images/chartMessage/feedback.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form target="_self" name="form1" id="etwform"   method="post" onsubmit="return send();">
        <div class="eachitem">
            <div class="etwleft"><b>*</b>Email</div>
            <div class="etwright">
                <input type="text" id="email" title="Please make sure your email address is correct,otherwise the recipient will not be able to reply" name="email" class="textarea_style" onchange="borderstyle(this)" onclick="clearemail()" onblur="recheckemail();SetCookie('c_email',this.value)" value="Your Email" />
            </div>
        </div>

        <div class="eachitem" id="areaheight">
            <div class="etwleft" style="margin-top: 80px;"><b>*</b>Content</div>
            <div class="etwright">
                <textarea id="message" name="message" class="textarea_style" onblur="SetCookie('c_message',this.value);" title="For the Best results,we recommend including the following details:self introduction,required specifications,inquire about price,and so on"> </textarea>
            </div>

        </div>
        <div class="eachitem">
            <div class="etwleft">Product Name</div>

            <div class="etwright">
                <input type="text" id="title" name="title" class="textarea_style" onblur="SetCookie('c_title',this.value);" title="Product Name" value="" />
            </div>
        </div>
        <div class="eachitem">
            <div class="etwleft">Your Name</div>
            <div class="etwright">
                <input type="text" class="textarea_style" title="your full name." onblur="SetCookie('c_contacter',this.value);" value="" id="contacter" name="contacter" />
            </div>
        </div>
        <div class="eachitem">
            <div class="etwleft">Company</div>
            <div class="etwright">
                <input type="text" class="textarea_style" value="" name="company" onblur="SetCookie('c_company',this.value);" id="company" title="Your Company Name." />

            </div>
        </div>

        <div class="eachitem">
            <div class="etwleft">Tel./Fax.</div>

            <div class="etwright">
                <input type="text" class="textarea_style" value="" id="telephone" name="telephone" onblur="SetCookie('c_telephone',this.value);" title="Telephone No. or Fax No." />
            </div>
        </div>
        <div class="eachitem">
            <div class="etwleft">Msn/Skype</div>
            <div class="etwright">
                <input type="text" class="textarea_style" value="" name="fax" id="fax" onblur="SetCookie('c_fax',this.value);" title="Msn No. or Skype No." />
            </div>
        </div>
       
        <div align="center" class="etw09buttom">
         
            <input type="submit" class="button textarea_style" id="sendmessagebutton" value="Send" title="Click here to send message to us" />

        </div>
        <div id="showresultmsg"></div>
    </form>
    <script type="text/javascript" language="javascript">
        function recheckemail() {
            var email = document.getElementById("email");
            if ((email.value).indexOf("@@") < 1) {
                email.value = "Your Email";
            }
        }
        /*以上代码为e-mail文本框验证*/

        function send() {
            var email = document.getElementById("email");
            var message = document.getElementById("message");
            if (!window.ActiveXObject) {
                if (window.localStorage) {
                    window.localStorage['email'] = email.value;
                    window.localStorage['yourname'] = document.getElementById('contacter').value;
                }
            }
            if ((email.value).indexOf("@@") < 1) {
                email.value = "Your Email";
                email.style.cssText = "font-weight:bold; color:#990000; border:2px solid #80FF00;";
                return false;
            }

            if (message.value == " ") {
                alert("please enter your email address,message to the input box");
                return false;
            }
            
            delCookie('c_email');
            delCookie('c_message');
            delCookie('c_title');
            delCookie('c_contacter');
            delCookie('c_company');
            delCookie('c_telephone');
            delCookie('c_fax');
            $("#sendmessagebutton").hide();
            $.ajax({
                type: "POST",
                url: "@Url.Action("sendMessage")",
                data: $("form").serialize(),
                success: function (msg) {
                    alert("Success!\r\nThanks for your message. We will reply in a timely manner");
                    parent.window.document.getElementById("chat2012").style.display = "none";
                    $(parent.document).find(".etwchatboxclosebox a").click();
                    $("#sendmessagebutton").show();
                }
            });

            return false;

        } ;

        read_cookie();

    </script>
</body>
</html>
